package com.bw.zg3park2212.Staff

import androidx.lifecycle.MutableLiveData
import com.bw.base.entity.StaffEntity
import com.bw.base.entity.StaffEntityItem
import com.bw.base.mvvm.BaseViewModel
import com.bw.base.net.ApiService
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class StaffViewModel  @Inject constructor(val apiServise: ApiService): BaseViewModel() {
    val staffSuccse=MutableLiveData<StaffEntity>()
    fun getstaff(){
        httpRequst(
            {apiServise.getStaff()},
            staffSuccse::postValue
        )
    }
    val staffXiangSuccse=MutableLiveData<StaffEntityItem>()
    fun getstaffxing(id:Int){
        httpRequst(
            {apiServise.getStaffXiang(id)},
            staffXiangSuccse::postValue
        )
    }
    val staffDelSuccse=MutableLiveData<Boolean>()
    fun getstaffdel(id:Int){
        httpRequst(
            {apiServise.getStaffDel(id)},
            staffDelSuccse::postValue
        )
    }
}